package order.job;

import com.alibaba.fastjson.JSONObject;
import com.well.rpc.job.WellJobContext;
import com.well.rpc.job.WellJobHandler;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * <p>
 * hello job
 * </p>
 *
 * @author weedo
 * @since 2022/8/6
 */
@Component
public class HelloWordJob implements WellJobHandler {

    @Override

    public void handleJob(WellJobContext context) {
        try {
            Thread.sleep(60* 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Map<String, Object> param = context.getParam();
        System.out.println(JSONObject.toJSONString(param));
        System.out.println("hello, Well-Job");
    }

    @Override
    public String cronTrigger() {
        return "1 * * * * ?";
    }
}
